<%
begin
  if @stock_type=='S'
    stock = Stock.find(:first, :conditions=>["id=?",@id])
    if stock
      pass,label = check_est_event_pass(stock, @stock_type, @event_date, @min_est, @max_est, @min_event, @max_event)
      xml = get_checkchart_xml(pass,label)
%>
      <span id='chartdiv_<%=@no%>' align='center'></span>
      <script type='text/javascript'>
        var myChart = new FusionCharts("/Charts/HLinearGauge.swf", "myChartId<%=@no%>", "280", "55", "0", "0");
        myChart.setDataXML("<%=xml%>");
        myChart.render("chartdiv_<%=@no%>");
      </script>
<%
    end
  else
    stock = UserStock.find(:first, :conditions=>["id=?",@id])
    if stock
      pass,label = check_est_event_pass(stock, @stock_type, @event_date, @min_est, @max_est, @min_event, @max_event)
      xml = get_checkchart_xml(pass,label)
%>
      <span id='chartdiv_<%=@no%>' align='center'></span>
      <script type='text/javascript'>
        var myChart = new FusionCharts("/Charts/HLinearGauge.swf", "myChartId<%=@no%>", "280", "55", "0", "0");
        myChart.setDataXML("<%=xml%>");
        myChart.render("chartdiv_<%=@no%>");
      </script>
<%
    end
  end
rescue
%>
      Something Wrong!;
<%
end
%>